/*
 * Project: Digital Wristwatch
 * Author: Zak Kemble, contact@zakkemble.co.uk
 * Copyright: (C) 2013 by Zak Kemble
 * License: GNU GPL v3 (see License.txt)
 * Web: http://blog.zakkemble.co.uk/diy-digital-wristwatch/
 */

#ifndef SLEEP_H_
#define SLEEP_H_

#include "typedefs.h"

typedef enum
{
	PWR_ACTIVE_BUZZER = 0,
	PWR_ACTIVE_VIBRA,
	PWR_ACTIVE_DISPLAY,
	PWR_ACTIVE_BUTTONS,
	PWR_ACTIVE_STOPWATCH,
	PWR_ACTIVE_ALARM,
	PWR_ACTIVE_HOURBEEP,
	PWR_ACTIVE_COUNT // This should always be last
} pwr_active_t;

typedef enum
{
	PWR_STATE_NONE, // Power down sleep allowed
	PWR_STATE_IDLE, // Idle sleep allowed
	PWR_STATE_BSY // No sleep allowed
} pwr_state_t;

void pwrmgr_init(void);
void pwrmgr_update(void);
void pwrmgr_setState(pwr_active_t, pwr_state_t);
bool pwrmgr_userActive(void);

#endif /* SLEEP_H_ */